package com.yunshipei.core.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.HashMap;

public class RequestHeaderSSOModel implements Parcelable {
    private String host = "";
    private HashMap<String, String> addHeaders = new HashMap<>();

    public RequestHeaderSSOModel(String host, HashMap<String, String> addHeaders) {
        this.host = host;
        this.addHeaders = addHeaders;
    }

    protected RequestHeaderSSOModel(Parcel in) {
        host = in.readString();
        addHeaders = in.readHashMap(HashMap.class.getClassLoader());
    }

    public static final Creator<RequestHeaderSSOModel> CREATOR = new Creator<RequestHeaderSSOModel>() {
        @Override
        public RequestHeaderSSOModel createFromParcel(Parcel in) {
            return new RequestHeaderSSOModel(in);
        }

        @Override
        public RequestHeaderSSOModel[] newArray(int size) {
            return new RequestHeaderSSOModel[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(host);
        dest.writeMap(addHeaders);
    }

    public String getHost() {
        return host;
    }

    public HashMap<String, String> getAddHeaders() {
        return addHeaders;
    }
}
